package com.wss.common.wechat.util;

import com.wss.common.wechat.cache.WeChatCache;

/**
 * @author 赵飞
 * @version V1.0
 * @Title: 微信开放平台相关接口
 * @Package com.evermotion.common.wechat.util
 * @Description:
 * @date 2017/8/30
 */
public class OpenWeChatInterfaceUtil {

	//获取第三方平台component_access_token
	private static final String API_COMPONENT_TOKEN = "https://api.weixin.qq.com/cgi-bin/component/api_component_token";

	//获取预授权码
	private static final String API_CREATE_PREAUTHCODE = "https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode?component_access_token=";

	//获取授权公众号或小程序的接口调用凭据刷新（令牌）
	private static final String API_QUERY_AUTH = "https://api.weixin.qq.com/cgi-bin/component/api_query_auth?component_access_token=";

	//刷新授权公众号或小程序的接口调用凭据（令牌）
	//private static final String API_AUTHORIZER_TOKEN = "https://api.weixin.qq.com/cgi-bin/component/api_authorizer_token?component_access_token=";


	public static String getApiComponentToken() {
		return API_COMPONENT_TOKEN;
	}

	public static String getApiCreatePreauthcode() {
		return API_CREATE_PREAUTHCODE+WeChatCache.getApiComponentToken();
	}

	public static String getApiQueryAuth() {
		return API_QUERY_AUTH+WeChatCache.getApiComponentToken();
	}
}
